﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.MainModule.Entities;
using Domain.Core.Specification;

namespace Domain.MainModule.SoundexCodes
{
    public class SoundexCodeUserIdSpecification:Specification<SoundexCode>
    {

        Guid _userId;

        public SoundexCodeUserIdSpecification(Guid userId)
        {
            this._userId = userId;
        }

        public override System.Linq.Expressions.Expression<Func<SoundexCode, bool>> SatisfiedBy()
        {
            Specification<SoundexCode> spec = new TrueSpecification<SoundexCode>();

            spec &= new DirectSpecification<SoundexCode>(c => c.UserId == this._userId);

            return spec.SatisfiedBy();

        }
    }
}
